<?php
/**
 * tpAdmin [a web admin based ThinkPHP5]
 *
 * @author yuan1994 <tianpian0805@gmail.com>
 * @link http://tpadmin.yuan1994.com/
 * @copyright 2016 yuan1994 all rights reserved.
 * @license http://www.apache.org/licenses/LICENSE-2.0
 */

//------------------------
// 广告图片

//-------------------------

namespace app\common\model;

use think\Model;
use think\Db;

class Adpic extends Model
{
    public function getad($id){
        $lunbopic = Db::table("tp_project_case")->where(array("typeid" => $id, 'isdelete' => 0))->order("`order` desc")->select();
        if(count($lunbopic) > 0){
            foreach($lunbopic as $k => $v){
                $lunbopic[$k]['pic'] = str_replace('\\', '/', $v['pic']); 
            }
        }
        return $lunbopic;
    }
}